﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ABMTitulos.aspx.cs" Inherits="Bukstor.Admin.UI.ABMTitulos"
    MasterPageFile="~/MasterAdmin.Master" Theme="skinAdmin" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>ABM - Titulos</title>
</asp:Content>
<asp:Content ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div>
        <asp:Table ID="Table1" runat="server" >
            <asp:TableRow>
                <asp:TableCell>
                    <asp:Label ID="lblIdLibro" runat="server" Text="Id Libro"></asp:Label></asp:TableCell>
                <asp:TableCell>
                    <asp:TextBox ID="txtIdLibro" runat="server" Enabled="False"></asp:TextBox></asp:TableCell>
            </asp:TableRow>
            <asp:TableRow>
                <asp:TableCell>
                    <asp:Label ID="lblIsbn" runat="server" Text="ISBN"></asp:Label></asp:TableCell>
                <asp:TableCell>
                    <asp:TextBox ID="txtIsbn" runat="server"></asp:TextBox><asp:RequiredFieldValidator
                        ID="RequiredFieldValidator1" runat="server" ErrorMessage="Falta el ISBN" Text="*"
                        ControlToValidate="txtIsbn"></asp:RequiredFieldValidator></asp:TableCell>
            </asp:TableRow>
            <asp:TableRow>
                <asp:TableCell>
                    <asp:Label ID="lblTitulo" runat="server" Text="Titulo"></asp:Label></asp:TableCell>
                <asp:TableCell>
                    <asp:TextBox ID="txtTitulo" runat="server"></asp:TextBox><asp:RequiredFieldValidator
                        ID="RequiredFieldValidator2" runat="server" ErrorMessage="Falta el titulo del libro"
                        ControlToValidate="txtTitulo" Text="*"></asp:RequiredFieldValidator></asp:TableCell>
            </asp:TableRow>
            <asp:TableRow>
                <asp:TableCell>
                    <asp:Button ID="btnAutores" runat="server" Text="AUTORES" PostBackUrl="~/Autores.aspx"/>
                    <asp:Label ID="lblAutor" runat="server" Text="Autor"></asp:Label></asp:TableCell>
                <asp:TableCell>
                    <asp:DropDownList  ID="ddlAutores" runat="server" DataSourceID="EntityDataSource2"
                    DataTextField="apellido" AutoPostBack="True" >                        
                    </asp:DropDownList>
                </asp:TableCell>
            </asp:TableRow>
            <asp:TableRow>
                <asp:TableCell>
                    <asp:Button ID="btnEditoriales" runat="server" Text="EDITORIALES" PostBackUrl="~/Editoriales.aspx"/>
                    <asp:Label ID="lblEditorial" runat="server" Text="Editorial"></asp:Label></asp:TableCell>
                <asp:TableCell>
                    <asp:DropDownList ID="ddlEditorial" runat="server" DataSourceID="SqlDataSource1" AutoPostBack="true"
                    DataValueField="nombre">
                    </asp:DropDownList>
                </asp:TableCell>
            </asp:TableRow>
            <asp:TableRow>
                <asp:TableCell>
                    <asp:Label ID="lblTapa" runat="server" Text="Tapa"></asp:Label></asp:TableCell>
                <asp:TableCell>
                    <asp:Image ID="imgTapa" runat="server" /></asp:TableCell>
            </asp:TableRow>
            <asp:TableRow>
                <asp:TableCell>
                    <asp:Label ID="lblSinopsis" runat="server" Text="Sinopsis"></asp:Label></asp:TableCell>
                <asp:TableCell>
                    <asp:TextBox ID="txtSinopsis" runat="server"></asp:TextBox></asp:TableCell>
            </asp:TableRow>
            <asp:TableRow>
                <asp:TableCell>
                    <asp:Button ID="btnSubcategorias" runat="server" Text="SUBCATEGORIAS" PostBackUrl="~/Subcategorias.aspx"/>
                    <asp:Label ID="lblSubcategoria" runat="server" Text="Subcategoria"></asp:Label></asp:TableCell>
                <asp:TableCell>
                    <asp:DropDownList ID="ddlSubcategorias" runat="server" DataSourceID="EntityDataSource1"
                        DataTextField="nombre" AutoPostBack="True">
                    </asp:DropDownList>
                </asp:TableCell>
            </asp:TableRow>
            <asp:TableRow>
                <asp:TableCell>
                    <asp:Label ID="lblDiscontinuo" runat="server" Text="Discontinuo"></asp:Label></asp:TableCell>
                <asp:TableCell>
                    <asp:DropDownList ID="ddlDiscontinuo" runat="server">
                        <asp:ListItem>si</asp:ListItem>
                        <asp:ListItem>no</asp:ListItem>
                    </asp:DropDownList>
                </asp:TableCell>
            </asp:TableRow>
            <asp:TableRow>
                <asp:TableCell>
                    <asp:Label ID="lblPrecio" runat="server" Text="Precio"></asp:Label></asp:TableCell>
                <asp:TableCell>
                    <asp:TextBox ID="txtPrecio" runat="server"></asp:TextBox></asp:TableCell>
            </asp:TableRow>
            <asp:TableRow>
                <asp:TableCell ColumnSpan="2">
                    <asp:Button ID="btnAceptar" runat="server" Text="ACEPTAR" ValidationGroup="autor"
                        PostBackUrl="~/Titulos.aspx" /></asp:TableCell>
            </asp:TableRow>
        </asp:Table>
        <asp:ValidationSummary ID="ValidationSummary1" runat="server" HeaderText="No se completaron datos"
            ShowSummary="true" ValidationGroup="autor" />
    </div>
    <asp:EntityDataSource ID="EntityDataSource1" runat="server" ConnectionString="name=BukstorBDEntities"
        DefaultContainerName="BukstorBDEntities" EntitySetName="Subcategorias" Select="it.[nombre]">
    </asp:EntityDataSource>
    <asp:EntityDataSource ID="EntityDataSource2" runat="server" ConnectionString="name=BukstorBDEntities"
        DefaultContainerName="BukstorBDEntities" EnableFlattening="False" EntitySetName="Autores"
        Select="it.[apellido]">
    </asp:EntityDataSource>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:BukstorBDConnectionString %>" 
        SelectCommand="SELECT DISTINCT nombre FROM Editoriales"></asp:SqlDataSource>
</asp:Content>
